package xyz.molzhao.alink.api.request;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.web.multipart.MultipartFile;

import java.io.InputStream;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class StorageContextRequest {
    //上传的文件
    private MultipartFile file;

    //文件目录
    private String directory;

    //时间标记
    private boolean timeFlag;

    //文件名
    private String fileName;

    //是否使用https
    private boolean useHttps = true;

    private InputStream inputStream;

    public static StorageContextRequest defaultRequest(MultipartFile file) {
        StorageContextRequest request = new StorageContextRequest();
        request.setFileName(file.getOriginalFilename());
        request.setDirectory("molzhao");
        request.setFile(file);
        return request;
    }
}
